package com.spc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/*There are multiple implementations of "Discovery Service" (eureka, consul, zookeeper)
 @EnableDiscoveryClient lives in spring-cloud-commons and picks the implementation
 on the classpath. @EnableEurekaClient lives in spring-cloud-netflix and only works for eureka.
 If eureka is on your classpath, they are effectively the same.*/
//参考文档 https://blog.csdn.net/forezp/article/details/69788938
@SpringBootApplication
@EnableDiscoveryClient
public class ServiceRibbonApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceRibbonApplication.class, args);
    }

    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
